package com.web.transaction;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.domain.TreatmentTransaction;
import com.service.TransactionService;
import com.util.AuthenticateHttpServlet;

@WebServlet("/Transaction/Treatment/RefundForm")
public class TreatmentRefundTransactionForm extends AuthenticateHttpServlet {

	@Override
	protected void post(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		int code = Integer.parseInt(request.getParameter("code"));
		TransactionService service = new TransactionService();
		TreatmentTransaction t = service.searchTransactionById(code);
		request.setAttribute("transaction", t);
		request.getRequestDispatcher("/WEB-INF/jsp/treatmentRefund.jsp").forward(request, response);
	}

}
